<div xmlns:ext="http://www.extjs.com" class="body-wrap"><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.util.Observable.html" ext:member="" ext:cls="Ext.util.Observable">Observable</a>
  <img src="resources/elbow-end.gif"><a href="output/Ext.util.Stateful.html" ext:member="" ext:cls="Ext.util.Stateful">Stateful</a>
    <img src="resources/elbow-end.gif">Model</pre></div><h1>Class <a href="source/Model.html#cls-Ext.data.Model">Ext.data.Model</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/Model.html#cls-Ext.data.Model">Model.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Model.html#cls-Ext.data.Model">Model</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.util.Stateful.html" ext:cls="Ext.util.Stateful" ext:member="">Stateful</a></td></tr></table><div class="description"><p>A Model represents some object that your application manages. For example, one might define a Model for Users, Products,
Cars, or any other real-world object that we want to model in the system. Models are registered via the <a href="output/Ext.ModelMgr.html" ext:cls="Ext.ModelMgr">model manager</a>,
and are used by <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">stores</a>, which are in turn used by many of the data-bound components in Ext.</p>
<p>Models are defined as a set of fields and any arbitrary methods and properties relevant to the model. For example:</p>
<pre><code>Ext.regModel(<em>'User'</em>, {
    fields: [
        {name: <em>'name'</em>,  type: <em>'string'</em>},
        {name: <em>'age'</em>,   type: <em>'int'</em>},
        {name: <em>'phone'</em>, type: <em>'string'</em>},
        {name: <em>'alive'</em>, type: <em>'boolean'</em>, defaultValue: true}
    ],

    changeName: <b>function</b>() {
        <b>var</b> oldName = this.get(<em>'name'</em>),
            newName = oldName + <em>" The Barbarian"</em>;

        this.set(<em>'name'</em>, newName);
    }
});</code></pre>
<p>The fields array is turned into a <a href="output/Ext.util.MixedCollection.html" ext:cls="Ext.util.MixedCollection">MixedCollection</a> automatically by the <a href="output/Ext.ModelMgr.html" ext:cls="Ext.ModelMgr">ModelMgr</a>, and all
other functions and properties are copied to the new Model's prototype.</p>
<p>Now we can create instances of our User model and call any model logic we defined:</p>
<pre><code><b>var</b> user = Ext.ModelMgr.create({
    name : <em>'Conan'</em>,
    age  : 24,
    phone: <em>'555-555-5555'</em>
}, <em>'User'</em>);

user.changeName();
user.get(<em>'name'</em>); <i>//returns <em>"Conan The Barbarian"</em></i></code></pre>
<p><u>Validations</u></p>
<p>Models have built-in support for validations, which are executed against the validator functions in 
<a href="output/Ext.data.validations.html" ext:cls="Ext.data.validations">Ext.data.validations</a> (<a href="output/Ext.data.validations.html" ext:cls="Ext.data.validations">see all validation functions</a>). Validations are easy to add to models:</p>
<pre><code>Ext.regModel(<em>'User'</em>, {
    fields: [
        {name: <em>'name'</em>,     type: <em>'string'</em>},
        {name: <em>'age'</em>,      type: <em>'int'</em>},
        {name: <em>'phone'</em>,    type: <em>'string'</em>},
        {name: <em>'gender'</em>,   type: <em>'string'</em>},
        {name: <em>'username'</em>, type: <em>'string'</em>},
        {name: <em>'alive'</em>,    type: <em>'boolean'</em>, defaultValue: true}
    ],

    validations: [
        {type: <em>'presence'</em>,  field: <em>'age'</em>},
        {type: <em>'length'</em>,    field: <em>'name'</em>,     min: 2},
        {type: <em>'inclusion'</em>, field: <em>'gender'</em>,   list: [<em>'Male'</em>, <em>'Female'</em>]},
        {type: <em>'exclusion'</em>, field: <em>'username'</em>, list: [<em>'Admin'</em>, <em>'Operator'</em>]},
        {type: <em>'format'</em>,    field: <em>'username'</em>, matcher: /([a-z]+)[0-9]{2,3}/}
    ]
});</code></pre>
<p>The validations can be run by simply calling the <a href="output/Ext.data.Model.html#Ext.data.Model-validate" ext:member="validate" ext:cls="Ext.data.Model">validate</a> function, which returns a <a href="output/Ext.data.Errors.html" ext:cls="Ext.data.Errors">Ext.data.Errors</a>
object:</p>
<pre><code><b>var</b> instance = Ext.ModelMgr.create({
    name: <em>'Ed'</em>,
    gender: <em>'Male'</em>,
    username: <em>'edspencer'</em>
}, <em>'User'</em>);

<b>var</b> errors = instance.validate();</code></pre>
<p><u>Associations</u></p>
<p>Models can have associations with other Models via <a href="output/Ext.data.BelongsToAssociation.html" ext:cls="Ext.data.BelongsToAssociation">belongsTo</a> and 
<a href="output/Ext.data.HasManyAssociation.html" ext:cls="Ext.data.HasManyAssociation">hasMany</a> associations. For example, let's say we're writing a blog administration
application which deals with Users, Posts and Comments. We can express the relationships between these models like this:</p>
<pre><code>Ext.regModel(<em>'Post'</em>, {
    fields: [<em>'id'</em>, <em>'user_id'</em>],

    belongsTo: <em>'User'</em>,
    hasMany  : {model: <em>'Comment'</em>, name: <em>'comments'</em>}
});

Ext.regModel(<em>'Comment'</em>, {
    fields: [<em>'id'</em>, <em>'user_id'</em>, <em>'post_id'</em>],

    belongsTo: <em>'Post'</em>
});

Ext.regModel(<em>'User'</em>, {
    fields: [<em>'id'</em>],

    hasMany: [
        <em>'Post'</em>,
        {model: <em>'Comment'</em>, name: <em>'comments'</em>}
    ]
});</code></pre>
<p>See the docs for <a href="output/Ext.data.BelongsToAssociation.html" ext:cls="Ext.data.BelongsToAssociation">Ext.data.BelongsToAssociation</a> and <a href="output/Ext.data.HasManyAssociation.html" ext:cls="Ext.data.HasManyAssociation">Ext.data.HasManyAssociation</a> for details on the usage
and configuration of associations. Note that associations can also be specified like this:</p>
<pre><code>Ext.regModel(<em>'User'</em>, {
    fields: [<em>'id'</em>],

    associations: [
        {type: <em>'hasMany'</em>, model: <em>'Post'</em>,    name: <em>'posts'</em>},
        {type: <em>'hasMany'</em>, model: <em>'Comment'</em>, name: <em>'comments'</em>}
    ]
});</code></pre>
<p><u>Using a Proxy</u></p>
<p>Models are great for representing types of data and relationships, but sooner or later we're going to want to 
load or save that data somewhere. All loading and saving of data is handled via a <a href="output/Ext.data.Proxy.html" ext:cls="Ext.data.Proxy">Proxy</a>, 
which can be set directly on the Model:</p>
<pre><code>Ext.regModel(<em>'User'</em>, {
    fields: [<em>'id'</em>, <em>'name'</em>, <em>'email'</em>],

    proxy: {
        type: <em>'rest'</em>,
        url : <em>'/users'</em>
    }
});</code></pre>
<p>Here we've set up a <a href="output/Ext.data.RestProxy.html" ext:cls="Ext.data.RestProxy">Rest Proxy</a>, which knows how to load and save data to and from a 
RESTful backend. Let's see how this works:</p>
<pre><code><b>var</b> user = Ext.ModelMgr.create({name: <em>'Ed Spencer'</em>, email: <em>'ed@sencha.com'</em>}, <em>'User'</em>);

user.save(); <i>//POST /users</i></code></pre>
<p>Calling <a href="output/Ext.data.Model.html#Ext.data.Model-save" ext:member="save" ext:cls="Ext.data.Model">save</a> on the new Model instance tells the configured RestProxy that we wish to persist this 
Model's data onto our server. RestProxy figures out that this Model hasn't been saved before because it doesn't
have an id, and performs the appropriate action - in this case issuing a POST request to the url we configured
(/users). We configure any Proxy on any Model and always follow this API - see <a href="output/Ext.data.Proxy.html" ext:cls="Ext.data.Proxy">Ext.data.Proxy</a> for a full
list.</p>
<p>Loading data via the Proxy is equally easy:</p>
<pre><code><i>//get a reference to the User model class</i>
<b>var</b> User = Ext.ModelMgr.getModel(<em>'User'</em>);

<i>//Uses the configured RestProxy to make a GET request to /users/123</i>
User.load(123, {
    success: <b>function</b>(user) {
        console.log(user.getId()); <i>//logs 123</i>
    }
});</code></pre>
<p>Models can also be updated and destroyed easily:</p>
<pre><code><i>//the user Model we loaded <b>in</b> the last snippet:</i>
user.set(<em>'name'</em>, <em>'Edward Spencer'</em>);

<i>//tells the Proxy to save the Model. In this <b>case</b> it will perform a PUT request to /users/123 as this Model already has an id</i>
user.save({
    success: <b>function</b>() {
        console.log(<em>'The User was updated'</em>);
    }
});

<i>//tells the Proxy to destroy the Model. Performs a DELETE request to /users/123</i>
user.destroy({
    success: <b>function</b>() {
        console.log(<em>'The User was destroyed!'</em>);
    }
});</code></pre>
<p><u>Usage in Stores</u></p>
<p>It is very common to want to load a set of Model instances to be displayed and manipulated in the UI. We do this 
by creating a <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Store</a>:</p>
<pre><code><b>var</b> store = <b>new</b> Ext.data.Store({
    model: <em>'User'</em>
});

<i>//uses the Proxy we set up on Model to load the Store data</i>
store.load();</code></pre>
<p>A Store is just a collection of Model instances - usually loaded from a server somewhere. Store can also maintain
a set of added, updated and removed Model instances to be synchronized with the server via the Proxy. See the
<a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Store docs</a> for more information on Stores.</p></div><div class="hr"></div><a id="Ext.data.Model-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row  "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-idProperty"></a><b><a href="source/Model.html#cfg-Ext.data.Model-idProperty">idProperty</a></b> : String<div class="mdesc">The name of the field treated as this Model's unique id (defaults to 'id').</div></td><td class="msource">Model</td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-listeners"></a><b><a href="source/Observable.html#cfg-Ext.util.Observable-listeners">listeners</a></b> : Object<div class="mdesc"><div class="short">A config object containing one or more event handlers to be added to this
object during initialization.  This should ...</div><div class="long"><p>A config object containing one or more event handlers to be added to this
object during initialization.  This should be a valid listeners config object as specified in the
<a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> example for attaching multiple handlers at once.</p>
<br><p><b><u>DOM events from ExtJs <a href="output/Ext.Component.html" ext:cls="Ext.Component">Components</a></u></b></p>
<br><p>While <i>some</i> ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
is usually only done when extra value can be added. For example the <a href="output/Ext.DataView.html" ext:cls="Ext.DataView">DataView</a>'s
<b><code><a href="output/Ext.DataView.html#Ext.DataView-click" ext:member="click" ext:cls="Ext.DataView">click</a></code></b> event passing the node clicked on. To access DOM
events directly from a child element of a Component, we need to specify the <code>element</code> option to
identify the Component property to add a DOM listener to:
<pre><code><b>new</b> Ext.Panel({
    width: 400,
    height: 200,
    dockedItems: [{
        xtype: <em>'toolbar'</em>
    }],
    listeners: {
        click: {
            element: <em>'el'</em>, <i>//bind to the underlying el property on the panel</i>
            fn: <b>function</b>(){ console.log(<em>'click el'</em>); }
        },
        dblclick: {
            element: <em>'body'</em>, <i>//bind to the underlying body property on the panel</i>
            fn: <b>function</b>(){ console.log(<em>'dblclick body'</em>); }
        }
    }
});</code></pre>
</p></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#listeners" ext:member="#listeners" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-persistanceProperty"></a><b><a href="source/Stateful.html#cfg-Ext.util.Stateful-persistanceProperty">persistanceProperty</a></b> : String<div class="mdesc"><div class="short">The property on this Persistable object that its data is saved to.
Defaults to 'data' (e.g. all persistable data resi...</div><div class="long">The property on this Persistable object that its data is saved to.
Defaults to 'data' (e.g. all persistable data resides in this.data.)</div></div></td><td class="msource"><a href="output/Ext.util.Stateful.html#persistanceProperty" ext:member="#persistanceProperty" ext:cls="Ext.util.Stateful">Stateful</a></td></tr></tbody></table><a id="Ext.data.Model-props"></a><h2>Public Properties</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Property</th><th class="msource-header">Defined By</th></tr><tr class="property-row  inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-dirty"></a><b><a href="source/Stateful.html#prop-Ext.util.Stateful-dirty">dirty</a></b> : Boolean<div class="mdesc">Readonly flag - true if this Record has been modified.</div></td><td class="msource"><a href="output/Ext.util.Stateful.html#dirty" ext:member="#dirty" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="property-row  inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-editing"></a><b><a href="source/Stateful.html#prop-Ext.util.Stateful-editing">editing</a></b> : Boolean<div class="mdesc">Internal flag used to track whether or not the model instance is currently being edited. Read-only</div></td><td class="msource"><a href="output/Ext.util.Stateful.html#editing" ext:member="#editing" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="property-row  inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-modified"></a><b><a href="source/Stateful.html#prop-Ext.util.Stateful-modified">modified</a></b> : Object<div class="mdesc">Key: value pairs of all fields whose values have changed</div></td><td class="msource"><a href="output/Ext.util.Stateful.html#modified" ext:member="#modified" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="property-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-phantom"></a><b><a href="source/Model.html#prop-Ext.data.Model-phantom">phantom</a></b> : Boolean<div class="mdesc"><div class="short">true when the record does not yet exist in a server-side database (see
setDirty).  Any record which has a real databa...</div><div class="long"><tt>true</tt> when the record does not yet exist in a server-side database (see
<a href="output/Ext.data.Model.html#Ext.data.Model-setDirty" ext:member="setDirty" ext:cls="Ext.data.Model">setDirty</a>).  Any record which has a real database pk set as its id property
is NOT a phantom -- it's real.</div></div></td><td class="msource">Model</td></tr><tr class="property-row  "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-store"></a><b><a href="source/Model.html#prop-Ext.data.Model-store">store</a></b> : Ext.data.Store<div class="mdesc">The <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Ext.data.Store</a> to which this Record belongs.</div></td><td class="msource">Model</td></tr></tbody></table><a id="Ext.data.Model-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-Model"></a><b class="constructor"><a href="source/Model.html#cls-Ext.data.Model">Model</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Object&nbsp;data</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Number&nbsp;id</span><span class="closeparen">&nbsp;)</span><div class="mdesc"><div class="short"></div><div class="long"><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>data</code> : Object<div class="sub-desc">An object containing keys corresponding to this model's fields, and their associated values</div></li><li><code>id</code> : Number<div class="sub-desc">Optional unique ID to assign to this model instance</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-Model.id"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-Model.id">Model.id</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Record&nbsp;rec</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">String</span><div class="mdesc"><div class="short">Generates a sequential id. This method is typically called when a record is created
and no id has been specified. The...</div><div class="long">Generates a sequential id. This method is typically called when a record is <a href="output/Ext.data.Model.html#Ext.data.Model-create" ext:member="create" ext:cls="Ext.data.Model">create</a>d
and <a href="output/Ext.data.Model.html#Ext.data.Model-Record" ext:member="Record" ext:cls="Ext.data.Model">no id has been specified</a>. The returned id takes the form:
<tt>&#123;PREFIX}-&#123;AUTO_ID}</tt>.<div class="mdetail-params"><ul>
<li><b><tt>PREFIX</tt></b> : String<p class="sub-desc"><tt>Ext.data.Model.PREFIX</tt>
(defaults to <tt>'ext-record'</tt>)</p></li>
<li><b><tt>AUTO_ID</tt></b> : String<p class="sub-desc"><tt>Ext.data.Model.AUTO_ID</tt>
(defaults to <tt>1</tt> initially)</p></li>
</ul></div><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>rec</code> : Record<div class="sub-desc">The record being created.  The record does not exist, it's a <a href="output/Ext.data.Model.html#Ext.data.Model-phantom" ext:member="phantom" ext:cls="Ext.data.Model">phantom</a>.</div></li></ul><strong>Returns:</strong><ul><li><code>String</code><div class="sub-desc">auto-generated string id, &lt;tt&gt;"ext-record-i++'&lt;/tt&gt;;</div></li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-addEvents"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-addEvents">addEvents</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Object|String&nbsp;o</span><span class="comma">,&nbsp;</span><span title="Required" class="required">string&nbsp;Optional.</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Adds the specified events to the list of events which this Observable may fire.</div><div class="long">Adds the specified events to the list of events which this Observable may fire.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>o</code> : Object|String<div class="sub-desc">Either an object with event names as properties with a value of <code>true</code>
or the first event name string if multiple event names are being passed as separate parameters.</div></li><li><code>Optional.</code> : string<div class="sub-desc">Event name if multiple event names are being passed as separate parameters.
Usage:<pre><code>this.addEvents(<em>'storeloaded'</em>, <em>'storecleared'</em>);</code></pre></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#addEvents" ext:member="#addEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-addListener"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-addListener">addListener</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String&nbsp;eventName</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Function&nbsp;handler</span><span class="comma">,&nbsp;</span><span title="Optional" class="optional">[Object&nbsp;scope]</span><span class="comma">,&nbsp;</span><span title="Optional" class="optional">[Object&nbsp;options]</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Appends an event handler to this object.</div><div class="long">Appends an event handler to this object.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to listen for. May also be an object who's property names are event names. See</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
<b>If omitted, defaults to the object which fired the event.</b></div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration.
properties. This may contain any of the following properties:<ul>
<li><b>scope</b> : Object<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
<b>If omitted, defaults to the object which fired the event.</b></div></li>
<li><b>delay</b> : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>
<li><b>single</b> : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
<li><b>buffer</b> : Number<div class="sub-desc">Causes the handler to be scheduled to run in an <a href="output/Ext.util.DelayedTask.html" ext:cls="Ext.util.DelayedTask">Ext.util.DelayedTask</a> delayed
by the specified number of milliseconds. If the event fires again within that time, the original
handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
<li><b>target</b> : Observable<div class="sub-desc">Only call the handler if the event was fired on the target Observable, <i>not</i>
if the event was bubbled up from a child Observable.</div></li>
<li><b>element</b> : String<div class="sub-desc"><b>This option is only valid for listeners bound to <a href="output/Ext.Component.html" ext:cls="Ext.Component">Components</a>.</b>
The name of a Component property which references an element to add a listener to.
<p>This option is useful during Component construction to add DOM event listeners to elements of <a href="output/Ext.Component.html" ext:cls="Ext.Component">Components</a> which
will exist only after the Component is rendered. For example, to add a click listener to a Panel's body:<pre><code><b>new</b> Ext.Panel({
    title: <em>'The title'</em>,
    listeners: {
        click: this.handlePanelClick,
        element: <em>'body'</em>
    }
});</code></pre></p>
<p>When added in this way, the options available are the options applicable to <a href="output/Ext.Element.html#Ext.Element-addListener" ext:member="addListener" ext:cls="Ext.Element">Ext.Element.addListener</a></p></div></li>
</ul><br>
<p>
<b>Combining Options</b><br>
Using the options argument, it is possible to combine different types of listeners:<br>
<br>
A delayed, one-time listener.
<pre><code>myPanel.on(<em>'hide'</em>, this.handleClick, this, {
single: true,
delay: 100
});</code></pre>
<p>
<b>Attaching multiple handlers in 1 call</b><br>
The method also allows for a single argument to be passed which is a config object containing properties
which specify multiple events. For example:<pre><code>myGridPanel.on({
    cellClick: this.onCellClick,
    mouseover: this.onMouseOver,
    mouseout: this.onMouseOut,
    scope: this <i>// Important. Ensure <em>"this"</em> is correct during handler execution</i>
});</code></pre>.
<p></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#addListener" ext:member="#addListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-addManagedListener"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-addManagedListener">addManagedListener</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Observable|Element&nbsp;item</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Object|String&nbsp;ename</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Function&nbsp;fn</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Object&nbsp;scope</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Object&nbsp;opt</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Adds listeners to any Observable object (or Element) which are automatically removed when this Component
is destroyed...</div><div class="long"><p>Adds listeners to any Observable object (or Element) which are automatically removed when this Component
is destroyed.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>item</code> : Observable|Element<div class="sub-desc">The item to which to add a listener/listeners.</div></li><li><code>ename</code> : Object|String<div class="sub-desc">The event name, or an object containing event name properties.</div></li><li><code>fn</code> : Function<div class="sub-desc">Optional. If the <code>ename</code> parameter was an event name, this
is the handler function.</div></li><li><code>scope</code> : Object<div class="sub-desc">Optional. If the <code>ename</code> parameter was an event name, this
is the scope (<code>this</code> reference) in which the handler function is executed.</div></li><li><code>opt</code> : Object<div class="sub-desc">Optional. If the <code>ename</code> parameter was an event name, this
is the <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> options.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#addManagedListener" ext:member="#addManagedListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-clearListeners"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-clearListeners">clearListeners</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Removes all listeners for this object including the managed listeners</div><div class="long">Removes all listeners for this object including the managed listeners<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#clearListeners" ext:member="#clearListeners" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-clearManagedListeners"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-clearManagedListeners">clearManagedListeners</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Removes all managed listeners for this object.</div><div class="long">Removes all managed listeners for this object.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#clearManagedListeners" ext:member="#clearManagedListeners" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-commit"></a><b class="method"><a href="source/Stateful.html#method-Ext.util.Stateful-commit">commit</a></b><span class="openparen">(&nbsp;</span><span title="Optional" class="optional">[Boolean&nbsp;silent]</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Usually called by the Ext.data.Store which owns the model instance.
Commits all changes made to the instance since ei...</div><div class="long">Usually called by the <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Ext.data.Store</a> which owns the model instance.
Commits all changes made to the instance since either creation or the last commit operation.
<p>Developers should subscribe to the <a href="output/Ext.data.Store.html#Ext.data.Store-update" ext:member="update" ext:cls="Ext.data.Store">Ext.data.Store.update</a> event
to have their code notified of commit operations.</p><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>silent</code> : Boolean<div class="sub-desc">(optional) True to skip notification of the owning
store of the change (defaults to false)</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Stateful.html#commit" ext:member="#commit" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-copy"></a><b class="method"><a href="source/Stateful.html#method-Ext.util.Stateful-copy">copy</a></b><span class="openparen">(&nbsp;</span><span title="Optional" class="optional">[String&nbsp;id]</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Record</span><div class="mdesc"><div class="short">Creates a copy (clone) of this Model instance.</div><div class="long">Creates a copy (clone) of this Model instance.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>id</code> : String<div class="sub-desc">(optional) A new id, defaults to the id
of the instance being copied. See <code><a href="output/Ext.util.Stateful.html#Ext.util.Stateful-id" ext:member="id" ext:cls="Ext.util.Stateful">id</a></code>. 
To generate a phantom instance with a new id use:<pre><code><b>var</b> rec = record.copy(); <i>// clone the record</i>
Ext.data.Model.id(rec); <i>// automatically generate a unique sequential id</i></code></pre></div></li></ul><strong>Returns:</strong><ul><li><code>Record</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Stateful.html#copy" ext:member="#copy" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-enableBubble"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-enableBubble">enableBubble</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String/Array&nbsp;events</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Enables events fired by this Observable to bubble up an owner hierarchy by calling
this.getBubbleTarget() if present....</div><div class="long"><p>Enables events fired by this Observable to bubble up an owner hierarchy by calling
<code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p>
<p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="output/Ext.Component.getBubbleTarget.html" ext:cls="Ext.Component.getBubbleTarget">Ext.Component.getBubbleTarget</a>. The default
implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
access the required target more quickly.</p>
<p>Example:</p><pre><code>Ext.override(Ext.form.Field, {
<i>//  Add functionality to Field&#39;s initComponent to enable the change event to bubble</i>
initComponent : Ext.createSequence(Ext.form.Field.prototype.initComponent, <b>function</b>() {
    this.enableBubble(<em>'change'</em>);
}),

<i>//  We know that we want Field&#39;s events to bubble directly to the FormPanel.</i>
getBubbleTarget : <b>function</b>() {
    <b>if</b> (!this.formPanel) {
        this.formPanel = this.findParentByType(<em>'form'</em>);
    }
    <b>return</b> this.formPanel;
}
});

<b>var</b> myForm = <b>new</b> Ext.formPanel({
title: <em>'User Details'</em>,
items: [{
    ...
}],
listeners: {
    change: <b>function</b>() {
        <i>// Title goes red <b>if</b> form has been modified.</i>
        myForm.header.setStyle(<em>'color'</em>, <em>'red'</em>);
    }
}
});</code></pre><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>events</code> : String/Array<div class="sub-desc">The event name to bubble, or an Array of event names.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#enableBubble" ext:member="#enableBubble" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-fireEvent"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-fireEvent">fireEvent</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String&nbsp;eventName</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Object...&nbsp;args</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Boolean</span><div class="mdesc"><div class="short">Fires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Obse...</div><div class="long"><p>Fires the specified event with the passed parameters (minus the event name).</p>
<p>An event may be set to bubble up an Observable parent hierarchy (See <a href="output/Ext.Component.html#Ext.Component-getBubbleTarget" ext:member="getBubbleTarget" ext:cls="Ext.Component">Ext.Component.getBubbleTarget</a>)
by calling <a href="output/Ext.util.Observable.html#Ext.util.Observable-enableBubble" ext:member="enableBubble" ext:cls="Ext.util.Observable">enableBubble</a>.</p><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to fire.</div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers.</div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true.</div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#fireEvent" ext:member="#fireEvent" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-get"></a><b class="method"><a href="source/Stateful.html#method-Ext.util.Stateful-get">get</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String&nbsp;fieldName</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Mixed</span><div class="mdesc"><div class="short">Returns the value of the given field</div><div class="long">Returns the value of the given field<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>fieldName</code> : String<div class="sub-desc">The field to fetch the value for</div></li></ul><strong>Returns:</strong><ul><li><code>Mixed</code><div class="sub-desc">The value</div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Stateful.html#get" ext:member="#get" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-getChanges"></a><b class="method"><a href="source/Stateful.html#method-Ext.util.Stateful-getChanges">getChanges</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Object</span><div class="mdesc"><div class="short">Gets a hash of only the fields that have been modified since this Model was created or commited.</div><div class="long">Gets a hash of only the fields that have been modified since this Model was created or commited.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>Object</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Stateful.html#getChanges" ext:member="#getChanges" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-getId"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-getId">getId</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Number</span><div class="mdesc"><div class="short">Returns the unique ID allocated to this model instance as defined by idProperty</div><div class="long">Returns the unique ID allocated to this model instance as defined by <a href="output/Ext.data.Model.html#Ext.data.Model-idProperty" ext:member="idProperty" ext:cls="Ext.data.Model">idProperty</a><div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>Number</code><div class="sub-desc">The id</div></li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-getProxy"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-getProxy">getProxy</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Ext.data.Proxy</span><div class="mdesc"><div class="short">Returns the configured Proxy for this Model</div><div class="long">Returns the configured Proxy for this Model<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>Ext.data.Proxy</code><div class="sub-desc">The proxy</div></li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-hasListener"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-hasListener">hasListener</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String&nbsp;eventName</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Boolean</span><div class="mdesc"><div class="short">Checks to see if this object has any listeners for a specified event</div><div class="long">Checks to see if this object has any listeners for a specified event<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#hasListener" ext:member="#hasListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-isModified"></a><b class="method"><a href="source/Stateful.html#method-Ext.util.Stateful-isModified">isModified</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String&nbsp;fieldName</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Boolean</span><div class="mdesc"><div class="short">Returns true if the passed field name has been modified
since the load or last commit.</div><div class="long">Returns <tt>true</tt> if the passed field name has been <code><a href="output/Ext.util.Stateful.html#Ext.util.Stateful-modified" ext:member="modified" ext:cls="Ext.util.Stateful">modified</a></code>
since the load or last commit.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>fieldName</code> : String<div class="sub-desc"><a href="output/Ext.data.Field.html#Ext.data.Field-name" ext:member="name" ext:cls="Ext.data.Field">Ext.data.Field.name</a></div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Stateful.html#isModified" ext:member="#isModified" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-join"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-join">join</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Ext.data.Store&nbsp;store</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Tells this model instance that it has been added to a store</div><div class="long">Tells this model instance that it has been added to a store<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>store</code> : Ext.data.Store<div class="sub-desc">The store that the model has been added to</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-load"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-load">load</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Number&nbsp;id</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Object&nbsp;config</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">&lt;static&gt;&nbsp;Static. Asynchronously loads a model instance by id. Sample usage:
MyApp.User = Ext.regModel('User', {
    fields: [
...</div><div class="long">&lt;static&gt;&nbsp;<b>Static</b>. Asynchronously loads a model instance by id. Sample usage:
<pre><code>MyApp.User = Ext.regModel(<em>'User'</em>, {
    fields: [
        {name: <em>'id'</em>, type: <em>'int'</em>},
        {name: <em>'name'</em>, type: <em>'string'</em>}
    ]
});

MyApp.User.load(10, {
    scope: this,
    failure: <b>function</b>(record, operation) {
        <i>//<b>do</b> something <b>if</b> the load failed</i>
    },
    success: <b>function</b>(record, operation) {
        <i>//<b>do</b> something <b>if</b> the load succeeded</i>
    },
    callback: <b>function</b>(record, operation) {
        <i>//<b>do</b> something whether the load succeeded or failed</i>
    }
});</code></pre><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>id</code> : Number<div class="sub-desc">The id of the model to load</div></li><li><code>config</code> : Object<div class="sub-desc">Optional config object containing success, failure and callback functions, plus optional scope</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-on"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-on">on</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String&nbsp;eventName</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Function&nbsp;handler</span><span class="comma">,&nbsp;</span><span title="Optional" class="optional">[Object&nbsp;scope]</span><span class="comma">,&nbsp;</span><span title="Optional" class="optional">[Object&nbsp;options]</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Appends an event handler to this object (shorthand for addListener.)</div><div class="long">Appends an event handler to this object (shorthand for <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a>.)<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
<b>If omitted, defaults to the object which fired the event.</b></div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#on" ext:member="#on" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-reject"></a><b class="method"><a href="source/Stateful.html#method-Ext.util.Stateful-reject">reject</a></b><span class="openparen">(&nbsp;</span><span title="Optional" class="optional">[Boolean&nbsp;silent]</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Usually called by the Ext.data.Store to which this model instance has been joined.
Rejects all changes made to the mo...</div><div class="long">Usually called by the <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Ext.data.Store</a> to which this model instance has been <a href="output/Ext.util.Stateful.html#Ext.util.Stateful-join" ext:member="join" ext:cls="Ext.util.Stateful">joined</a>.
Rejects all changes made to the model instance since either creation, or the last commit operation.
Modified fields are reverted to their original values.
<p>Developers should subscribe to the <a href="output/Ext.data.Store.html#Ext.data.Store-update" ext:member="update" ext:cls="Ext.data.Store">Ext.data.Store.update</a> event
to have their code notified of reject operations.</p><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>silent</code> : Boolean<div class="sub-desc">(optional) True to skip notification of the owning
store of the change (defaults to false)</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Stateful.html#reject" ext:member="#reject" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-relayEvents"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-relayEvents">relayEvents</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Object&nbsp;o</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Array&nbsp;events</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Relays selected events from the specified Observable as if the events were fired by this.</div><div class="long">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>o</code> : Object<div class="sub-desc">The Observable whose events this object is to relay.</div></li><li><code>events</code> : Array<div class="sub-desc">Array of event names to relay.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#relayEvents" ext:member="#relayEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-removeListener"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-removeListener">removeListener</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String&nbsp;eventName</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Function&nbsp;handler</span><span class="comma">,&nbsp;</span><span title="Optional" class="optional">[Object&nbsp;scope]</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Removes an event handler.</div><div class="long">Removes an event handler.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The type of event the handler was associated with.</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove. <b>This must be a reference to the function passed into the <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> call.</b></div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope originally specified for the handler.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#removeListener" ext:member="#removeListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-removeManagedListener"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-removeManagedListener">removeManagedListener</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Observable|Element&nbsp;item</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Object|String&nbsp;ename</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Function&nbsp;fn</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Object&nbsp;scope</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Removes listeners that were added by the mon method.</div><div class="long">Removes listeners that were added by the <a href="output/Ext.util.Observable.html#Ext.util.Observable-mon" ext:member="mon" ext:cls="Ext.util.Observable">mon</a> method.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>item</code> : Observable|Element<div class="sub-desc">The item from which to remove a listener/listeners.</div></li><li><code>ename</code> : Object|String<div class="sub-desc">The event name, or an object containing event name properties.</div></li><li><code>fn</code> : Function<div class="sub-desc">Optional. If the <code>ename</code> parameter was an event name, this
is the handler function.</div></li><li><code>scope</code> : Object<div class="sub-desc">Optional. If the <code>ename</code> parameter was an event name, this
is the scope (<code>this</code> reference) in which the handler function is executed.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#removeManagedListener" ext:member="#removeManagedListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-resumeEvents"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-resumeEvents">resumeEvents</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Resume firing events. (see suspendEvents)
If events were suspended using the queueSuspended parameter, then all
event...</div><div class="long">Resume firing events. (see <a href="output/Ext.util.Observable.html#Ext.util.Observable-suspendEvents" ext:member="suspendEvents" ext:cls="Ext.util.Observable">suspendEvents</a>)
If events were suspended using the <tt><b>queueSuspended</b></tt> parameter, then all
events fired during event suspension will be sent to any listeners now.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#resumeEvents" ext:member="#resumeEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-save"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-save">save</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Object&nbsp;options</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Ext.data.Model</span><div class="mdesc"><div class="short">Saves the model instance using the configured proxy</div><div class="long">Saves the model instance using the configured proxy<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>options</code> : Object<div class="sub-desc">Options to pass to the proxy</div></li></ul><strong>Returns:</strong><ul><li><code>Ext.data.Model</code><div class="sub-desc">The Model instance</div></li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-set"></a><b class="method"><a href="source/Stateful.html#method-Ext.util.Stateful-set">set</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String|Object&nbsp;fieldName</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Mixed&nbsp;value</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Sets the given field to the given value, marks the instance as dirty</div><div class="long">Sets the given field to the given value, marks the instance as dirty<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>fieldName</code> : String|Object<div class="sub-desc">The field to set, or an object containing key/value pairs</div></li><li><code>value</code> : Mixed<div class="sub-desc">The value to set</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Stateful.html#set" ext:member="#set" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Stateful-setDirty"></a><b class="method"><a href="source/Stateful.html#method-Ext.util.Stateful-setDirty">setDirty</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Marks this Record as dirty.  This method
is used interally when adding phantom records to a
writer enabled store.
Mar...</div><div class="long"><p>Marks this <b>Record</b> as <code><a href="output/Ext.util.Stateful.html#Ext.util.Stateful-dirty" ext:member="dirty" ext:cls="Ext.util.Stateful">dirty</a></code>.  This method
is used interally when adding <code><a href="output/Ext.util.Stateful.html#Ext.util.Stateful-phantom" ext:member="phantom" ext:cls="Ext.util.Stateful">phantom</a></code> records to a
<a href="output/Ext.data.Store.html#Ext.data.Store-writer" ext:member="writer" ext:cls="Ext.data.Store">writer enabled store</a>.</p>
<br><p>Marking a record <code><a href="output/Ext.util.Stateful.html#Ext.util.Stateful-dirty" ext:member="dirty" ext:cls="Ext.util.Stateful">dirty</a></code> causes the phantom to
be returned by <a href="output/Ext.data.Store.html#Ext.data.Store-getModifiedRecords" ext:member="getModifiedRecords" ext:cls="Ext.data.Store">Ext.data.Store.getModifiedRecords</a> where it will
have a create action composed for it during <a href="output/Ext.data.Store.html#Ext.data.Store-save" ext:member="save" ext:cls="Ext.data.Store">store save</a>
operations.</p><div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Stateful.html#setDirty" ext:member="#setDirty" ext:cls="Ext.util.Stateful">Stateful</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-setId"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-setId">setId</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Number&nbsp;id</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Sets the model instance's id field to the given id</div><div class="long">Sets the model instance's id field to the given id<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>id</code> : Number<div class="sub-desc">The new id</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-setProxy"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-setProxy">setProxy</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String/Object/Ext.data.Proxy&nbsp;proxy</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Sets the Proxy to use for this model. Accepts any options that can be accepted by Ext.data.ProxyMgr.create</div><div class="long">Sets the Proxy to use for this model. Accepts any options that can be accepted by <a href="output/Ext.data.ProxyMgr.html#Ext.data.ProxyMgr-create" ext:member="create" ext:cls="Ext.data.ProxyMgr">Ext.data.ProxyMgr.create</a><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>proxy</code> : String/Object/Ext.data.Proxy<div class="sub-desc">The proxy</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-suspendEvents"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-suspendEvents">suspendEvents</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Boolean&nbsp;queueSuspended</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Suspend the firing of all events. (see resumeEvents)</div><div class="long">Suspend the firing of all events. (see <a href="output/Ext.util.Observable.html#Ext.util.Observable-resumeEvents" ext:member="resumeEvents" ext:cls="Ext.util.Observable">resumeEvents</a>)<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>queueSuspended</code> : Boolean<div class="sub-desc">Pass as true to queue up suspended events to be fired
after the <a href="output/Ext.util.Observable.html#Ext.util.Observable-resumeEvents" ext:member="resumeEvents" ext:cls="Ext.util.Observable">resumeEvents</a> call instead of discarding all suspended events;</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#suspendEvents" ext:member="#suspendEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-un"></a><b class="method"><a href="source/Observable.html#method-Ext.util.Observable-un">un</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">String&nbsp;eventName</span><span class="comma">,&nbsp;</span><span title="Required" class="required">Function&nbsp;handler</span><span class="comma">,&nbsp;</span><span title="Optional" class="optional">[Object&nbsp;scope]</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Removes an event handler (shorthand for removeListener.)</div><div class="long">Removes an event handler (shorthand for <a href="output/Ext.util.Observable.html#Ext.util.Observable-removeListener" ext:member="removeListener" ext:cls="Ext.util.Observable">removeListener</a>.)<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The type of event the handler was associated with.</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove. <b>This must be a reference to the function passed into the <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> call.</b></div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope originally specified for the handler.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#un" ext:member="#un" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-unjoin"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-unjoin">unjoin</a></b><span class="openparen">(&nbsp;</span><span title="Required" class="required">Ext.data.Store&nbsp;store</span><span class="closeparen">&nbsp;)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">void</span><div class="mdesc"><div class="short">Tells this model instance that it has been removed from the store</div><div class="long">Tells this model instance that it has been removed from the store<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>store</code> : Ext.data.Store<div class="sub-desc">The store to unjoin</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Model</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Model-validate"></a><b class="method"><a href="source/Model.html#method-Ext.data.Model-validate">validate</a></b><span class="openparen">(</span><span class="closeparen">)</span><span class="colon">&nbsp;:&nbsp;</span><span class="return">Ext.data.Errors</span><div class="mdesc"><div class="short">Validates the current data against all of its configured validations and returns an 
Errors object</div><div class="long">Validates the current data against all of its configured <a href="output/Ext.data.Model.html#Ext.data.Model-validations" ext:member="validations" ext:cls="Ext.data.Model">validations</a> and returns an 
<a href="output/Ext.data.Errors.html" ext:cls="Ext.data.Errors">Errors</a> object<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>Ext.data.Errors</code><div class="sub-desc">The errors object</div></li></ul></div></div></div></td><td class="msource">Model</td></tr></tbody></table><a id="Ext.data.Model-events"></a><h2>Public Events</h2><div class="no-members">This class has no public events.</div></div>